<template>
  <div class="recommend">
    <div v-for="item in homeRecommends" :key="item.image" class="recommend-item">
      <a :href="item.link">
        <img :src="item.image" alt="" @load="imgLoaded">
        <div>{{item.title}}</div>
      </a>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    homeRecommends: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  methods: {
    imgLoaded() {
      this.$emit('imgLoaded');
    }
  }
}
</script>

<style>
  .recommend{
    width: 100%;
    display: flex;
    text-align: center;
    font-size: 12px;
    
    padding: 10px 0 20px;

    border-bottom: 10px solid rgba(168, 168, 168, .2);
  }
  .recommend-item{
    flex: 1;
  }
  .recommend-item img{
    width: 70px;
    margin-bottom: 5px;
  }
</style>